Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update-discriminator-mapping #2280

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Michael-Wamae
Copy link
Contributor

  • chore: update-discriminator-mapping

fixes #2140

Copy link
Contributor

@MaggieKimani1 MaggieKimani1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we please add a test case for when the value in the mapping dictionary is a URI reference pointing to a schema in an external file as in the spec:
image

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
78.9% Coverage on New Code (required ≥ 80%)
30.2% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@@ -38,6 +38,7 @@ public async Task ParseBasicDiscriminatorShouldSucceed()
Mapping =
{
["puppy"] = new OpenApiSchemaReference("Dog", openApiDocument),
["kitten"] = new OpenApiSchemaReference("Cat" , openApiDocument, "Cat"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
["kitten"] = new OpenApiSchemaReference("Cat" , openApiDocument, "Cat"),
["kitten"] = new OpenApiSchemaReference("Cat" , openApiDocument, "https://gigantic-server.com/schemas/animals.json"),

Sorry, this is what I meant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v2 - discriminator mappings should be dictionary<string, OpenApiSchemaReference>
3 participants